/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * NonMemberControlPanel.java
 *
 * Created on Apr 2, 2012, 2:23:43 PM
 */
package pacificlms.MainPanel;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import pacificlms.LoggedMember;

/**
 * This panel contains the functions that student members can invoke
 * @author brianhhh
 */
public class ControlPanelMember extends javax.swing.JPanel {

    /** Creates new form NonMemberControlPanel */
    public ControlPanelMember() {
        initComponents();
        
        try
        {
            java.net.URL IconURL1 = getClass().getResource("/icons/search.png");
            Icon icn1 =  new ImageIcon(IconURL1);
            btnResourceSearch.setIcon(icn1);  

            java.net.URL IconURL2 = getClass().getResource("/icons/checkout.png");
            Icon icn2 =  new ImageIcon(IconURL2);
            btnCheckOut.setIcon(icn2); 


            java.net.URL IconURL3 = getClass().getResource("/icons/hold.png");
            Icon icn3 =  new ImageIcon(IconURL3);
            btnHold.setIcon(icn3);


            java.net.URL IconURL4 = getClass().getResource("/icons/renew.png");
            Icon icn4 =  new ImageIcon(IconURL4);
            btnRenew.setIcon(icn4);        

            java.net.URL IconURL5 = getClass().getResource("/icons/viewinfo.png");
            Icon icn5 =  new ImageIcon(IconURL5);
            btnMyMemberInfo.setIcon(icn5);
        }
        catch(Exception Ex)
        {
            System.err.println("Unable to load images");
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        btnResourceSearch = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        btnCheckOut = new javax.swing.JButton();
        btnRenew = new javax.swing.JButton();
        btnHold = new javax.swing.JButton();
        btnMyMemberInfo = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JSeparator();

        setFocusCycleRoot(true);
        setMaximumSize(new java.awt.Dimension(146, 537));
        setMinimumSize(new java.awt.Dimension(146, 537));
        setPreferredSize(new java.awt.Dimension(146, 537));
        setLayout(null);

        btnResourceSearch.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        btnResourceSearch.setText("Resource Search");
        btnResourceSearch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnResourceSearchActionPerformed(evt);
            }
        });
        add(btnResourceSearch);
        btnResourceSearch.setBounds(0, 0, 146, 21);
        add(jSeparator1);
        jSeparator1.setBounds(0, 29, 146, 2);

        btnCheckOut.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        btnCheckOut.setLabel("Check Out");
        btnCheckOut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCheckOutActionPerformed(evt);
            }
        });
        add(btnCheckOut);
        btnCheckOut.setBounds(0, 37, 146, 21);

        btnRenew.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        btnRenew.setText("Renew");
        btnRenew.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnRenewActionPerformed(evt);
            }
        });
        add(btnRenew);
        btnRenew.setBounds(0, 95, 146, 21);

        btnHold.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        btnHold.setText("Hold");
        btnHold.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnHoldActionPerformed(evt);
            }
        });
        add(btnHold);
        btnHold.setBounds(0, 66, 146, 21);

        btnMyMemberInfo.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        btnMyMemberInfo.setText("View my info");
        btnMyMemberInfo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMyMemberInfoActionPerformed(evt);
            }
        });
        add(btnMyMemberInfo);
        btnMyMemberInfo.setBounds(0, 132, 146, 21);
        add(jSeparator2);
        jSeparator2.setBounds(0, 124, 146, 2);
    }// </editor-fold>//GEN-END:initComponents

    /** Search for resource */
    private void btnResourceSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnResourceSearchActionPerformed
        MainPanel.GetMainPanel().AddCentralUIPanel(new SearchForResource(false));
    }//GEN-LAST:event_btnResourceSearchActionPerformed

    /** Create a Check Out */
    private void btnCheckOutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCheckOutActionPerformed
        MainPanel.GetMainPanel().AddCentralUIPanel(new ActionCheckOutCopyofResource());
    }//GEN-LAST:event_btnCheckOutActionPerformed

    /** Hold a resource */
    private void btnHoldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnHoldActionPerformed
        MainPanel.GetMainPanel().AddCentralUIPanel(new ActionHoldResource());
    }//GEN-LAST:event_btnHoldActionPerformed

    /** Renew a Check Out */
    private void btnRenewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRenewActionPerformed
        MainPanel.GetMainPanel().AddCentralUIPanel(new ActionRenewCopyofResource());
    }//GEN-LAST:event_btnRenewActionPerformed

    /** view my membership info */
    private void btnMyMemberInfoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMyMemberInfoActionPerformed
        MainPanel.GetMainPanel().AddCentralUIPanel(new InformationMember(LoggedMember.getInstance()));
    }//GEN-LAST:event_btnMyMemberInfoActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnCheckOut;
    private javax.swing.JButton btnHold;
    private javax.swing.JButton btnMyMemberInfo;
    private javax.swing.JButton btnRenew;
    private javax.swing.JButton btnResourceSearch;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    // End of variables declaration//GEN-END:variables
}
